{% load staticfiles %}

<header class="header">
    <nav class="navbar navbar-default navbar-static-top" role="navigation">
        <div class="container" id="container">
            <div class="navbar-header" id="navbar-self">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#menu">
                    <span class="sr-only">导航</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{% url 'index' %}"><img src="{% static "images/logo/logo.png" %} "></a>
            </div>


            <div class="collapse navbar-collapse" id="menu">
                <ul class="nav navbar-nav menu">


                    {% for ml in menu_list_l %}
                        {% if ml.childmenu|length_is:'0' %}
                            <li><a href="{{ ml.linkaddr }}">{{ ml.menuname }}</a></li>
                        {% else %}

                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                    {{ ml.menuname }}<span class="caret"></span>
                                </a>
                                <ul class="dropdown-menu">
                                    {% for cml in ml.childmenu %}
                                        <li><a href="{{ cml.linkaddr }}">{{ cml.menuname }}</a></li>
                                    {% endfor %}
                                </ul>
                            </li>
                        {% endif %}

                    {% endfor %}
{#                    <li><a href="#">联系我</a> </li>#}
                </ul>
            </div>
        </div>
    </nav>
</header>


